/ BBS in a Box 12
/ BBS in a box XII-1.iso / Files / Education / M / MathPad 2.15.sit / MathPad 2.15 / examples / regression ![]() | < prev | next > |
MacBinary | 1993-06-21 | 1.5 KB | [TEXT/MPAD] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, Mon Jun 21 18:04:05 1993, modified Mon Jun 21 18:04:05 1993, creator 'MPAD', type ASCII, 881 bytes "regression" , at 0x3f1 462 bytes resource | default (weak) | |
99% | file | data | default | |
74% | TrID | Macintosh plain text (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | siegfried | fmt/1762 MacBinary (II) | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [MPAD] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 72 65 67 72 65 73 | 73 69 6f 6e 00 00 00 00 |..regres|sion....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 41 | 44 00 00 00 00 00 00 00 |.TEXTMPA|D.......|
|00000050| 00 00 00 00 00 03 71 00 | 00 01 ce a8 4b e0 d5 a8 |......q.|....K...|
|00000060| 4b e0 d5 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |K.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 6b ab 00 00 |........|....k...|
|00000080| 2d 2d 20 22 6c 69 6e 65 | 61 72 20 72 65 67 72 65 |-- "line|ar regre|
|00000090| 73 73 69 6f 6e 22 20 66 | 69 74 20 78 2c 79 20 64 |ssion" f|it x,y d|
|000000a0| 61 74 61 20 74 6f 20 61 | 20 6c 69 6e 65 0d 2d 2d |ata to a| line.--|
|000000b0| 20 75 73 65 73 20 3a 3d | 20 74 6f 20 61 76 6f 69 | uses :=| to avoi|
|000000c0| 64 20 72 65 2d 63 61 6c | 63 75 6c 61 74 69 6e 67 |d re-cal|culating|
|000000d0| 20 73 75 6d 73 0d 73 75 | 6d 78 20 3a 3d 20 73 75 | sums.su|mx := su|
|000000e0| 6d 28 78 5b 69 5d 2c 69 | 2c 31 2c 6e 29 3a 0d 73 |m(x[i],i|,1,n):.s|
|000000f0| 75 6d 78 78 3a 3d 20 73 | 75 6d 28 78 5b 69 5d 5e |umxx:= s|um(x[i]^|
|00000100| 32 2c 69 2c 31 2c 6e 29 | 3a 0d 73 75 6d 79 20 3a |2,i,1,n)|:.sumy :|
|00000110| 3d 20 73 75 6d 28 79 5b | 69 5d 2c 69 2c 31 2c 6e |= sum(y[|i],i,1,n|
|00000120| 29 3a 0d 73 75 6d 79 79 | 3a 3d 20 73 75 6d 28 79 |):.sumyy|:= sum(y|
|00000130| 5b 69 5d 5e 32 2c 69 2c | 31 2c 6e 29 3a 0d 73 75 |[i]^2,i,|1,n):.su|
|00000140| 6d 78 79 3a 3d 20 73 75 | 6d 28 78 5b 69 5d 2a 79 |mxy:= su|m(x[i]*y|
|00000150| 5b 69 5d 2c 69 2c 31 2c | 6e 29 3a 0d 0d 53 78 78 |[i],i,1,|n):..Sxx|
|00000160| 3d 6e 2a 73 75 6d 78 78 | 2d 73 75 6d 78 5e 32 0d |=n*sumxx|-sumx^2.|
|00000170| 53 78 79 3d 6e 2a 73 75 | 6d 78 79 2d 73 75 6d 78 |Sxy=n*su|mxy-sumx|
|00000180| 2a 73 75 6d 79 0d 0d 73 | 6c 6f 70 65 3d 53 78 79 |*sumy..s|lope=Sxy|
|00000190| 2f 53 78 78 0d 69 6e 74 | 65 72 63 65 70 74 3d 28 |/Sxx.int|ercept=(|
|000001a0| 73 75 6d 78 78 2a 73 75 | 6d 79 2d 73 75 6d 78 2a |sumxx*su|my-sumx*|
|000001b0| 73 75 6d 78 79 29 2f 28 | 6e 2a 73 75 6d 78 78 2d |sumxy)/(|n*sumxx-|
|000001c0| 73 75 6d 78 5e 32 29 0d | 63 6f 72 72 65 6c 61 74 |sumx^2).|correlat|
|000001d0| 69 6f 6e 3d 53 78 79 2f | 73 71 72 74 28 53 78 78 |ion=Sxy/|sqrt(Sxx|
|000001e0| 2a 28 6e 2a 73 75 6d 79 | 79 2d 73 75 6d 79 5e 32 |*(n*sumy|y-sumy^2|
|000001f0| 29 29 0d 0d 2d 2d 20 75 | 73 65 72 20 6d 75 73 74 |))..-- u|ser must|
|00000200| 20 73 75 70 70 6c 79 20 | 61 20 64 61 74 61 20 66 | supply |a data f|
|00000210| 69 6c 65 20 6f 66 20 78 | 20 79 20 76 61 6c 75 65 |ile of x| y value|
|00000220| 73 2e 0d 64 61 74 61 3d | 72 65 61 64 28 22 78 79 |s..data=|read("xy|
|00000230| 64 61 74 61 22 29 0d 6e | 3d 63 6f 75 6e 74 28 64 |data").n|=count(d|
|00000240| 61 74 61 29 20 20 20 2d | 2d 20 6e 75 6d 62 65 72 |ata) -|- number|
|00000250| 20 6f 66 20 64 61 74 61 | 20 70 6f 69 6e 74 73 0d | of data| points.|
|00000260| 0d 2d 2d 20 66 69 6c 65 | 20 69 73 20 6f 72 67 61 |.-- file| is orga|
|00000270| 6e 69 7a 65 64 20 61 73 | 20 78 2c 79 20 70 61 69 |nized as| x,y pai|
|00000280| 72 73 2e 20 0d 78 5b 69 | 5d 3d 64 61 74 61 5b 69 |rs. .x[i|]=data[i|
|00000290| 2c 31 5d 20 64 69 6d 5b | 6e 5d 20 2d 2d 20 4d 61 |,1] dim[|n] -- Ma|
|000002a0| 6b 65 20 73 65 70 20 78 | 20 61 6e 64 20 79 20 61 |ke sep x| and y a|
|000002b0| 72 72 61 79 73 0d 79 5b | 69 5d 3d 64 61 74 61 5b |rrays.y[|i]=data[|
|000002c0| 69 2c 32 5d 20 64 69 6d | 5b 6e 5d 0d 0d 70 6c 6f |i,2] dim|[n]..plo|
|000002d0| 74 20 64 61 74 61 20 20 | 20 20 20 20 20 20 20 20 |t data | |
|000002e0| 20 20 20 20 20 20 2d 2d | 20 70 6c 6f 74 20 64 61 | --| plot da|
|000002f0| 74 61 20 70 6f 69 6e 74 | 73 0d 70 6c 6f 74 20 58 |ta point|s.plot X|
|00000300| 2a 73 6c 6f 70 65 2b 69 | 6e 74 65 72 63 65 70 74 |*slope+i|ntercept|
|00000310| 20 20 20 2d 2d 20 70 6c | 6f 74 20 62 65 73 74 20 | -- pl|ot best |
|00000320| 66 69 74 20 6c 69 6e 65 | 0d 0d 6c 61 62 65 6c 20 |fit line|..label |
|00000330| 73 6c 6f 70 65 3a 30 2e | 37 32 30 0d 6c 61 62 65 |slope:0.|720.labe|
|00000340| 6c 20 69 6e 74 65 72 63 | 65 70 74 3a 2d 31 2e 31 |l interc|ept:-1.1|
|00000350| 32 32 0d 6c 61 62 65 6c | 20 63 6f 72 72 65 6c 61 |22.label| correla|
|00000360| 74 69 6f 6e 3a 30 2e 39 | 37 33 0d 0d 2d 2d 20 4e |tion:0.9|73..-- N|
|00000370| 6f 74 65 3a 20 63 61 6e | 20 61 6c 73 6f 20 62 65 |ote: can| also be|
|00000380| 20 75 73 65 64 20 74 6f | 20 64 6f 20 32 20 70 61 | used to| do 2 pa|
|00000390| 72 61 6d 20 66 69 74 20 | 66 6f 72 20 6f 74 68 65 |ram fit |for othe|
|000003a0| 72 20 66 75 6e 63 74 69 | 6f 6e 73 2e 0d 7e 0d 20 |r functi|ons..~. |
|000003b0| 66 28 78 29 20 3d 20 2d | 63 6f 73 28 78 29 0d 20 |f(x) = -|cos(x). |
|000003c0| 70 6c 6f 74 20 66 28 58 | 29 2a 73 6c 6f 70 65 2b |plot f(X|)*slope+|
|000003d0| 6f 66 66 0d 20 78 5b 69 | 5d 3d 66 28 64 61 74 61 |off. x[i|]=f(data|
|000003e0| 5b 69 2c 31 5d 29 20 64 | 69 6d 5b 6e 5d 0d 7e 0d |[i,1]) d|im[n].~.|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 00 00 01 00 00 00 01 7c | 00 00 00 7c 00 00 00 52 |.......||...|...R|
|00000410| 80 0c 80 0c 80 0c 80 0c | 80 0c 80 0c 80 0c 80 0c |........|........|
|00000420| 80 0c 80 0c 80 0c 80 0c | 80 0c 80 0c 80 0c 80 0c |........|........|
|00000430| 0a 72 65 67 72 65 73 73 | 69 6f 6e 01 02 00 00 00 |.regress|ion.....|
|00000440| 50 61 72 74 53 49 54 78 | 00 00 00 00 00 00 00 00 |PartSITx|........|
|00000450| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 a9 7e bd ef 00 00 | 00 00 00 00 01 ce 80 9a |...~....|........|
|00000480| 80 9a 80 9a 80 9a 80 9a | 80 9a 00 9a 00 9e 00 a0 |........|........|
|00000490| 00 a2 00 a4 00 bc 80 ac | 00 ac 00 b0 00 ba 80 c6 |........|........|
|000004a0| 00 c6 80 ca 00 ca 00 ce | 80 d4 00 d4 00 de 00 e8 |........|........|
|000004b0| 80 ee 80 ee 80 ee 00 ee | 00 fc 81 04 81 04 81 04 |........|........|
|000004c0| 81 04 81 04 81 04 81 04 | 81 04 01 04 81 08 01 08 |........|........|
|000004d0| 01 0c 81 10 81 10 81 10 | 01 10 01 16 01 26 81 2e |........|.....&..|
|000004e0| 01 2e 01 38 81 3c 01 3c | 81 40 01 40 01 46 81 4e |...8.<.<|.@.@.F.N|
|000004f0| 01 4e 01 56 01 58 81 68 | 81 68 81 68 81 68 81 68 |.N.V.X.h|.h.h.h.h|
|00000500| 00 00 00 20 00 00 00 03 | 00 02 3f f9 8e fa 35 12 |... ....|..?...5.|
|00000510| 94 e9 c8 ae 01 41 01 2d | 00 04 00 27 00 b0 01 2b |.....A.-|...'...+|
|00000520| 01 47 00 28 00 00 00 54 | 3c a3 d7 0a 3f 80 00 00 |.G.(...T|<...?...|
|00000530| 0c 81 00 0c 20 73 6c 6f | 70 65 3a 30 2e 37 32 30 |.... slo|pe:0.720|
|00000540| 3c a3 d7 0a 3f 73 33 33 | 11 81 00 12 20 69 6e 74 |<...?s33|.... int|
|00000550| 65 72 63 65 70 74 3a 2d | 31 2e 31 32 32 00 3c a3 |ercept:-|1.122.<.|
|00000560| d7 0a 3f 66 66 66 12 81 | 00 12 20 63 6f 72 72 65 |..?fff..|.. corre|
|00000570| 6c 61 74 69 6f 6e 3a 30 | 2e 39 37 33 00 00 01 00 |lation:0|.973....|
|00000580| 00 00 01 7c 00 00 00 7c | 00 00 00 52 00 2b 76 84 |...|...||...R.+v.|
|00000590| 05 e2 00 00 00 1c 00 46 | 00 01 50 52 65 66 00 00 |.......F|..PRef..|
|000005a0| 00 12 4c 42 4c 53 00 00 | 00 1e 00 80 ff ff 00 00 |..LBLS..|........|
|000005b0| 00 00 00 2c 01 20 00 80 | 00 00 00 00 00 24 00 00 |...,. ..|.....$..|
|000005c0| 00 00 0b 70 6c 6f 74 20 | 6c 61 62 65 6c 73 00 00 |...plot |labels..|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+